package com.example.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

//        +------------+--------------+------+-----+-------------------+----------------+
//        | Field      | Type         | Null | Key | Default           | Extra          |
//        +------------+--------------+------+-----+-------------------+----------------+
//        | id         | int(11)      | NO   | PRI | NULL              | auto_increment |
//        | username   | varchar(100) | NO   | UNI | NULL              |                |
//        | password   | varchar(65)  | YES  |     | NULL              |                |
//        | photo      | varchar(500) | YES  |     | img/default.jpg   |                |
//        | createtime | timestamp    | NO   |     | CURRENT_TIMESTAMP |                |
//        | updatetime | timestamp    | NO   |     | CURRENT_TIMESTAMP |                |
//        | state      | int(11)      | YES  |     | 0                 |                |
//        | nickname   | varchar(50)  | NO   |     | NULL              |                |
//        | realname   | varchar(50)  | YES  |     |                   |                |
//        | idcard     | varchar(50)  | YES  |     |                   |                |
//        +------------+--------------+------+-----+-------------------+----------------+

@Data
public class UserInfo {

    private Integer id;
    private String username;
    private String password;
    private String photo;

    //格式化时间处理(处理到秒是为了精确冻结时间)
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private LocalDateTime createtime;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private LocalDateTime updatetime;

    private Integer state;
    private String nickname;
    private String realname;
    private String idcard;
    private String gitee;

}
